/*
 * 
 * LegendShop 多用户商城系统
 * 
 *  版权所有,并保留所有权利。
 * 
 */
package com.legendshop.oa.service.impl;

import java.util.List;

import com.legendshop.dao.support.CriteriaQuery;
import com.legendshop.dao.support.PageSupport;
import com.legendshop.oa.dao.MailLogDao;
import com.legendshop.oa.model.MailLog;
import com.legendshop.oa.service.MailLogService;
import com.legendshop.util.AppUtils;

/**
 * The Class MailLogServiceImpl.
 */
public class MailLogServiceImpl  implements MailLogService{
    private MailLogDao mailLogDao;

    public void setMailLogDao(MailLogDao mailLogDao) {
        this.mailLogDao = mailLogDao;
    }

    public List<MailLog> getMailLog(String userName) {
        return mailLogDao.getMailLog(userName);
    }

    public MailLog getMailLog(Long id) {
        return mailLogDao.getMailLog(id);
    }

    public void deleteMailLog(MailLog mailLog) {
        mailLogDao.deleteMailLog(mailLog);
    }

    public Long saveMailLog(MailLog mailLog) {
        if (!AppUtils.isBlank(mailLog.getId())) {
            updateMailLog(mailLog);
            return mailLog.getId();
        }
        return (Long) mailLogDao.save(mailLog);
    }

    public void updateMailLog(MailLog mailLog) {
        mailLogDao.updateMailLog(mailLog);
    }

    public PageSupport getMailLog(CriteriaQuery cq) {
        return mailLogDao.queryPage(cq);
    }

	@Override
	public PageSupport<MailLog> getMailLogPage(String curPageNO, MailLog mailLog) {
		return mailLogDao.getMailLogPage(curPageNO,mailLog);
	}
}
